/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2022-2023. All rights reserved.
 */

package util

import (
	"regexp"
	"strings"
	"unsafe"
)

func isEncrypt(content string) bool {
	_, err := regexp.MatchString(`^[0-9|A-Z]{100,}$`, content)
	if err != nil {
		return false
	}
	if !strings.HasPrefix(content, "0000") {
		return false
	}
	return true
}

// DecryptByDefaultAESKey use default asekey decrypt encryptedMSG
func DecryptByDefaultAESKey(encryptedMsg string) ([]byte, error) {
	return []byte(encryptedMsg), nil
}

func clearStrMem(s string) {
	tempS := *(*[]byte)(unsafe.Pointer(&s))
	for i := 0; i < len(s); i++ {
		tempS[i] = 0
	}
}
